package com.sunsheng.modules.quartz;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@EnableScheduling
@EnableAsync
public class TestScheduled {
    //每隔10秒执行一次
    @Async
//    @Scheduled(fixedRate = 10000)
    public void test() {
        System.out.println("===>" + new Date());
    }
}
